package com.prs.crm.service.flow;

import java.util.Collection;
import java.util.List;

import com.prs.crm.domain.flow.WorkFlow;
import com.prs.crm.service.BaseService;

public interface WorkFlowService extends BaseService<WorkFlow>{

	/**
	 * 获取启用状态下的流程
	 * @return
	 */
	Collection<WorkFlow> getEnableFlows();
	/**
	 * 启用流程
	 * @param workflow
	 */
	void executeEnable(WorkFlow workflow);
	
	/**
	 * 禁用流程
	 * @param workflow
	 */
	void executeDisable(WorkFlow workflow);
	
	/**
	 * 获取工作流的设计XML 
	 * @param flow
	 * @return
	 */
	String getDesginXml(WorkFlow flow);
	
	/**
	 * 根据可视化设计结果保存流程
	 */
	void saveDesgin(WorkFlow flow,String xml);
	
	
	/**
	 * 删除一个流程
	 * @param flow
	 * @return
	 */
	boolean removeFlow(WorkFlow flow);
	
	List<WorkFlow> getWorkFlow(String type);
	
	List<WorkFlow> getAllWorkFlow();
	
}
